package io.vincentwinner.systeminfoapi.api;

import io.vincentwinner.systeminfoapi.dao.ICommonHardwareDao;
import io.vincentwinner.systeminfoapi.service.IStaticInfoService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/computer")
public class ComputerController {

    @Resource(name = "staticInfoService")
    private IStaticInfoService staticInfoService;

    @Resource(name = "commonHardwareDao")
    private ICommonHardwareDao commonHardwareDao;

    @RequestMapping
    public Object root(){
        return static$();
    }

    @RequestMapping("/static")
    public Object static$(){
        return staticInfoService.getCommonHardwareInfo();
    }

    @RequestMapping("/serialNumber")
    public Object serialNumber(){
        return commonHardwareDao.getSerialNumber();
    }

    @RequestMapping("/uuid")
    public Object hardwareUUID(){
        return commonHardwareDao.getHardwareUUID();
    }

    @RequestMapping("/manufacturer")
    public Object manufacturer(){
        return commonHardwareDao.getManufacturer();
    }

    @RequestMapping("/model")
    public Object model(){
        return commonHardwareDao.getComputerModel();
    }

}
